﻿
@{
    ViewBag.Title = "AccAddPay"; 
}
<div class="panel panel-default" style="margin-top:10px;">
    <div class="panel-heading navb-bg">
        预交款
    </div>
    <div style="padding: 2px;padding-right:20px;">
        <table class="form">
            <tr>
                <th class="formTitle">实收款：</th>
                <td class="formValue">
                    <select id="ddlzffs" name="zffs" class="form-control required"> 
                    </select>
                </td>
                <th class="formTitle"><span class="required">*</span>金额：</th>
                <td class="formValue">
                    <input id="txtmoney" name="txtmoney" type="text" class="form-control required" placeholder="请输入金额" />
                </td>
                <th class="formTitle">凭证日期：</th>
                <td class="formValue">
                    <input id="txtpzrq" name="txtpzrq" type="text" class="form-control required" placeholder="" />
                </td>
                <th class="formTitle">凭证号：</th>
                <td class="formValue">
                    <input type="text" id="txtlpzh" class="form-control newtouch_Readonly" style="width: 49.5%;display: inline;" value="" />
                    <a id="receipt"  class="btn btn-primary" onclick=""><i class="fa"></i>凭证号</a>
                </td>
            </tr>
        </table>
    </div>
</div>
<div class="gridPanel">
    <table id="ReceiptPanel"></table>
</div>

<script>
    $(function () { 
        $("#receipt").click(function () {
            showReceiptPanel(); //弹出凭证号窗口
        }); 
        $("#ddlzffs").newtouchBindSelect({
            id: "xjzffsbh",
            text: "xjzffsmc",
            datasource: function () {
                //遍历数据源
                var resultObjArr = new Array(); 
                $.each(top.clients.SysForCashPayList, function (idx, val) {
                    if (val.zhxz == 'a') { 
                        resultObjArr.push(val);
                    } 
                }); 
                return resultObjArr;
            }
        });
        var d = new Date();
        var date = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
        $("#txtpzrq").val(date); 
        GetSJPZH();
    })


    //弹出获取凭证号的窗口
    function showReceiptPanel() {
        var cardNo = $("#kh").val(); 
        if (cardNo) {
            $.modalOpen({
                id: "ReceiptPanel",
                title: "选择凭证号",
                url: "/PatientManage/AccountManage/ChooseReceipt?t=" + Math.random(),
                width: "300px",
                height: "200px",
                callBack: function (iframeId) { 
                    top.frames[iframeId].ReceiptConfirm();
                }//窗口点确定的回调函数
            });
        } else { 
            $.modalAlert("请输入卡号或住院号", 'warning'); 
            $("#txt_keyword").focus();
        }
    }

</script>

